const Mock = require("mockjs");

let Random = Mock.Random;
Random.extend({
    getName: function () {
        let array = ["JAVA", "JAVASCRIPT", "HTML", "CSS", "MYSQL", "ORACLE", "JQUERY", "SERVLET", "JSP", "SPRING", "SPRING MVC"];
        return this.pick(array);
    }
})
let data = Mock.mock({
    "books|100": [{
        "id|+1": 1,
        "createDate": "@date('2021-MM-dd')",
        "name": "@getName()" + " 从入门到放弃",
        "price": "@integer(30, 100)",
        "count": "@integer(1, 10)"
    }]
});
// console.log(data);

module.exports = {
    books: data.books
}